function ToHtmlAndOpenFunction()
  " convert to html
  TOhtml
  " open it in browser
  !open %
  " wait a bit
  !sleep 2
  " remove the converted html file
  !rm %
  " quick the quickfix window
  q
  " redraw
  redraw!
endfunction

command! ToHtmlAndOpen silent! call ToHtmlAndOpenFunction()
